{% extends "layout/_layout_admin.html" %}

{% block content %}
<div id="box" style="margin: 10px 0px;">
    <div class="float-clear">
        <div class="float-left contentBox border-all" style="width:18%;margin: 0 0.5%;">
            <div class="content-title border-bottom">
                <span>设备巡检记录</span>
            </div>
            <div class="content-center">
                <p class="text-center" v-if="leftTreeLoading">正在加载中,请稍后.....</p>
                <p class="text-center" v-if="!leftTreeLoading && leftTreeList.length==0">暂时没有数据,请添加</p>
                <div id="treeview7" class="test"></div>
            </div>
        </div>
        <div class="float-left contentBox border-all" style="width:80.5%;overflow: auto;">
            <div class="content-title border-bottom" style="position:relative;">
                <span>{{treeTitle.name}}</span>
            </div>
            <div class="ibox-content" style="position:relative;">
                <button class="btn btn-default pull-right my-btn my-btn-remove" onclick="deleteClick()">删除</button>
                <button class="btn btn-default pull-right my-btn my-btn-add" onclick="addBtnClick()">添加</button>
                <button class="btn btn-default my-btn my-search-btn my-btn-search" style="top: 15px;left: 220px;">查询
                </button>
                <table id="table"
                       data-toggle="table"
                       data-toolbar=".toolbar"
                       data-pagination="true"
                       data-maintain-selected="true"
                       data-search="true"
                       data-show-refresh="true"
                       data-search-align="left"
                       data-toolbar-align="right">
                    <thead>
                    <tr>
                        <th data-width="40"></th>
                        <th data-align="center" data-field="facility_name">设施名称</th>
                        <th data-align="center" data-field="facility_location">设施位置</th>
                        <th data-width="60" data-align="center" data-field="facility_device_amount">设备数量</th>
                        <th data-width="100" data-align="center" data-field="check_device">已巡检设备数</th>
                        <th data-width="100" data-align="center" data-field="uncheck_device">未巡检设备数</th>
                        <th data-width="100" data-align="center" data-field="mistake">已有故障数量</th>
                        <th data-align="center" data-field="facility_user">巡检人</th>
                        <th data-align="center" data-field="date">巡检日期</th>
                        <th data-width="100" data-field="is_complete" data-align="center"
                            data-formatter="checkBoxFormatter">是否巡检完成
                        </th>
                        <th data-width="300" data-align="center" data-field="detail">详情</th>
                    </tr>
                    </thead>
                </table>
            </div>
        </div>
    </div>
</div>
{% endblock %}

{% block script %}
    <script>
        $(document).ready(function () {
            $(".contentBox").css({"height": $(document.body).height() - 20});
            $(window).resize(function () {//当浏览器大小变化时
                $(".contentBox").css({"height": $(document.body).height() - 20})
            });
            tableList()
        });
    </script>
{% endblock %}